package mgr

import (
	"idle/internal/game/attr"
	"idle/internal/game/hero"
	"idle/internal/game/monster"
)

type fightMgr struct {
}

func GetFightMgr() *fightMgr {
	return &fightMgr{}
}

// 计算命中率
func (mgr *fightMgr) CalHitRate(hero, target *hero.Hero) int {
	clvl := hero.Lv
	mlvl := target.Lv
	att := hero.GetAttr(attr.Att)
	def := target.GetAttr(attr.Def)
	return 2 * (clvl / (clvl + mlvl)) * (att / (att + def))
}

func (mgr *fightMgr) Fight(h *hero.Hero, mList []*monster.Monster) {

}
